import { OrgServiceApi } from "./_org";
import { AxiosResponse } from "axios";
import { objectToUrlParams } from "@/utils/common";
import service from "@/api";

class UserBeanServiceApi extends OrgServiceApi {
  getImportExcelUrl() {
    return this.baseUrl + "/importUserAndDept";
  }

  resetPass(bean: any, params?: any): Promise<AxiosResponse<any>> {
    let url = this.baseUrl + "/resetPass";
    url += objectToUrlParams(params, true);
    return service.post(url, bean);
  }
  // 更换头像 待完善
  updateUserImage(bean: any, params?: any): Promise<AxiosResponse<any>> {
    console.log(this.baseUrl);

    let url = this.baseUrl + "/updateUserImage";
    url += objectToUrlParams(params, true);
    return service.post(url, bean);
  }
  changePass(bean: any, params?: any): Promise<AxiosResponse<any>> {
    console.log(this.baseUrl);

    let url = this.baseUrl + "/changePass";
    url += objectToUrlParams(params, true);
    return service.post(url, bean);
  }
  // 用于处理关联部门org_id为空情况
  definequeryById(bean: any, params?: any): Promise<AxiosResponse<any>> {
    let url = this.baseUrl + "/queryById";
    url += objectToUrlParams(params, true);
    return service.get(url, { params: { ...bean } });
  }
}
const userBeanServiceApi = new UserBeanServiceApi("/UserBeanService");

export default userBeanServiceApi;
